package dnl.dtools.grm;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;

import ajul.lang.Args;

/**
 * Describes a semantic 'unreal' resource. 
 *  
 * @author Daniel Ore
 */
public class SemanticResource extends Resource {

	private String name;
	private Resource[] children;
	private Resource parent;
	
	public SemanticResource(URL url, String name, Resource[] children, Resource parent) {
		super(url);
		Args.assertNotNull(name);
		this.name = name;
		if(children == null){
			this.children = new Resource[0];
		}
		else {
			this.children = children;
		}
		this.parent = parent;
	}

	public boolean delete() throws IOException {
		return false;
	}

	public boolean exists() {
		return true;
	}

	public Resource getChild(String name) {
		return null;
	}

	public String getName() {
		return name;
	}

	public Resource getParent() {
		return parent;
	}

	public boolean isDirectory() {
		return true;
	}

	public Resource[] list() throws ResourceExtractionException {
		return children;
	}

	public boolean renameTo(Resource dest) throws IOException {
		return false;
	}

	@Override
	public InputStream getInputStream() throws IOException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getLastModified() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public OutputStream getOutputStream() throws IOException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getSize() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public boolean isArchive() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isArchiveEntry() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isHidden() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isLocal() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean mkDir() throws IOException {
		// TODO Auto-generated method stub
		return false;
	}

}
